﻿@model Applica.Models.SponsorInputs345xModel 
<p class="txt txt-c">The Welcome screen is what your customers will see every time they re-open your version of the Home Wizard app. They will also see your branding info on your app's confirmation screen whenever they change their personalization or when they add additional home.  </p>
<div class="tabInnar-content">
    <div class="row">
        <div class="col-md-4 col-sm-4">
          
                 <div class="img text-center welcomeLeftImage">
                        <img class="img-responsive phoneImagewelcome" alt="" src="@Url.Content("~/images/mobile/mobile3.jpg")">
                         <img style="display:none;" class="img-responsive phoneImagewelcome" alt="" src="@Url.Content("~/images/mobile/hand-android.jpg")">
                         <img style="display:none;" class="img-responsive imgReplaceAndroid-Iphone phoneImagewelcome1" alt="" src="@Url.Content("~/images/see as iphone.png")">
                         <img  class="img-responsive imgReplaceAndroid-Iphone phoneImagewelcome1" alt="" src="@Url.Content("/images/see as android.png")">
                        </div>
             
        </div>
            <div class="col-md-8 col-sm-8">
                      
                      <div class="upload_view WebVerupload_view_Welcome">

                              <div class="up_view">
                                <div id="spnMessagewelcome"></div>
                                <div class="form-group">
                                <div class=" col-sm-3">
                                  <div class="user_img-l "><img id="imglogo" src='@Url.Content("~/sponsor_iphone_images/" + Model.ilogo_pic)' alt="" class="img-responsive img-thumbnail"> </div>


                                </div>
                                  <div class="col-sm-9">
                                    
                                    <div class="img-upload-data">
                                      <input type="file" id="fileupload" class="upload_img" name="files[]" multiple>
                                      <div class="progress progress-striped active">
                                        <div style="width: 0%" aria-valuemax="100" aria-valuemin="0" aria-valuenow="45" role="progressbar" class="progress-bar"> <span class="sr-only">0% Complete</span> </div>
                                      </div>
                                     @{
                             var displaynone = "";
                             if (Model.ilogo_pic == "Default.jpg")
                             {
                                 displaynone = "none";
                             }
                             else
                             {
                                 displaynone = "block";

                             }
                     <div id="divRestore" style="display:@displaynone;">
            <span class="image-save">Image saved</span>
                
                 @using (Ajax.BeginForm("restoreFile", "MobileVersion", new AjaxOptions
                 {
                     HttpMethod = "POST",
                     LoadingElementId = "loaderdefaultimage",
                     InsertionMode = System.Web.Mvc.Ajax.InsertionMode.Replace,
                     UpdateTargetId = "data",
                     OnSuccess = "OnSuccessDefault"

                 }, new { @class = "form-horizontal form clearfix" }))
                 { 
                    @Html.HiddenFor(model => model.Sponsor_ID)
                <span id="data" > </span>
                     <a class=".sendmail" style="text-decoration:underline;color:red;" href="javascript:void(0);" id="btnDefaultImageRestore">restore default image</a>@*
                   <input type="submit" value="Restore default image" id="btnDefaultImageRestore"/>*@  <div style="display: none" id="loaderdefaultimage">
                <img src="@Url.Content("~/images/ajax-loader.gif")" /></div>
                      
                 }
                <script>
                    function OnSuccessDefault(data) {
                        // alert(data.name);
                        $("#imglogo").attr("src", '../sponsor_iphone_images/' + data.name);
                        $("#divRestore").css("display", "none");
                    }

                </script>

            </div>
                                     }
              
                                    </div>
                                     </div>
                                </div>
                              </div>


                           @using (Ajax.BeginForm("Update", "MobileVersion", new AjaxOptions
                         {
                             HttpMethod = "POST",
                             LoadingElementId = "loader",
                             OnSuccess = "successwelcome"

                         }, new { @class = "form-horizontal form clearfix" }))
                         {
                               <div class="topup_view">
                                     @Html.HiddenFor(model => model.sponsor)
            

                              <div class="form-group">
                                <label for="CompanyName" class="col-sm-3 control-label">Company Name:</label>
                                <div class="col-sm-9">
                                     @Html.TextBoxFor(model => model.icompany_name, new { @class = "form-control IncWidth" })
                                  <a href="#" class="tooltip-icon"> <img src="@Url.Content("~/images/info_icon.png")" alt=""></a> </div>
                              </div>
                              <div class="form-group">
                                <label class="col-sm-3 control-label">Tag Line:</label>
                                <div class="col-sm-9">
                                     @Html.TextAreaFor(model => model.itagline, new { @class = "form-control IncWidth", @row = "3" })
                                  
                                  <a href="#" class="tooltip-icon"> <img src="@Url.Content("~/images/info_icon.png")" alt=""></a> </div>
                              </div>
                              
                              <div class="form-group">
                                <label for="YourName" class="col-sm-3 control-label">Your Name:</label>
                                <div class="col-sm-9">
                                    @Html.TextBoxFor(model => model.iname_line, new { @class = "form-control IncWidth" })
                                  
                                  <a href="#" class="tooltip-icon"> <img src="@Url.Content("~/images/info_icon.png")" alt=""></a> </div>
                              </div>
                              <div class="form-group">
                                <label for="Phone" class="col-sm-3 control-label">Phone:</label>
                                <div class="col-sm-9">
                                    @Html.TextBoxFor(model => model.iphone_number, new { @class = "form-control IncWidth" })
                                  <a href="#" class="tooltip-icon"> <img src="@Url.Content("~/images/info_icon.png")" alt=""></a> </div>
                              </div>
                              <div class="form-group">
                                <label for="Email" class="col-sm-3 control-label">Email:</label>
                                <div class="col-sm-9">
                                    @Html.TextBoxFor(model => model.iemail_address, new { @class = "form-control IncWidth" })
                                 
                                  <a href="#" class="tooltip-icon"> <img src="@Url.Content("~/images/info_icon.png")" alt=""></a> </div>
                              </div>
                              <div class="form-group">
                                <label for="Address" class="col-sm-3 control-label">Web Address:</label>
                                <div class="col-sm-9">
                                    @Html.TextBoxFor(model => model.iwebsite, new { @class = "form-control IncWidth" })
                                  <a href="#" class="tooltip-icon"> <img src="@Url.Content("~/images/info_icon.png")" alt=""></a> </div>
                              </div>
                                
                            </div>
                            <div class="save_btn">
                              <input type="submit" value="" id="btnSubmit">
                            </div>
                         }
                          
                        </div>
                      
                      </div>
                    </div>
                  </div>
  
  <script type="text/javascript">
      $(document).ready(function () {

          $('#fileupload').fileupload({
              dataType: 'json',
              url: '/MobileVersion/UploadFiles',
              autoUpload: true,
              formData: { id: $('#Sponsor_ID').val() },
              done: function (e, data) {

                  $('.file_name').html(data.result.name);
                  $('.file_type').html(data.result.type);
                  $('.file_size').html(data.result.size);
                  $('.file_imglogo').html('sponsor_iphone_images/' + data.result.path);
                  $("#imglogo").attr("src", '../sponsor_iphone_images/Defalt.png');
                  $("#imglogo").attr("src", "../sponsor_iphone_images/" + data.result.path + "?" +@DateTime.Now.Ticks.ToString() +"");
                  $("#divRestore").css("display", "block");
                  $("#loaderdefaultimage").css("display", "none");
                  $('.progress').hide();
              }
          }).on('fileuploadprogressall', function (e, data) {
              $('.progress').show();
              var progress = parseInt(data.loaded / data.total * 100, 10);
              $('.progress .progress-bar').css('width', progress + '%');
          });


      });
      $_blockDelete = false;
      $('#btnDefaultImageRestore').die('click').live('click', function () {
          var rconfirm = confirm('Are you sure?');
          if (rconfirm) {
              $('#form0').submit();
          }
      });
    </script>